/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.crossriver.crgis.database.model;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.util.Date;

/**
 * @author Wole Adetiba
 */
public class TransactionsClp extends BaseModelImpl<Transactions>
	implements Transactions {
	public TransactionsClp() {
	}

	public String getPrimaryKey() {
		return _transactionNo;
	}

	public void setPrimaryKey(String pk) {
		setTransactionNo(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return _transactionNo;
	}

	public String getTransactionNo() {
		return _transactionNo;
	}

	public void setTransactionNo(String transactionNo) {
		_transactionNo = transactionNo;
	}

	public String getUserId() {
		return _userId;
	}

	public void setUserId(String userId) {
		_userId = userId;
	}

	public String getTransactionRef() {
		return _transactionRef;
	}

	public void setTransactionRef(String transactionRef) {
		_transactionRef = transactionRef;
	}

	public String getItemId() {
		return _itemId;
	}

	public void setItemId(String itemId) {
		_itemId = itemId;
	}

	public String getItemDescription() {
		return _itemDescription;
	}

	public void setItemDescription(String itemDescription) {
		_itemDescription = itemDescription;
	}

	public String getPaymentType() {
		return _paymentType;
	}

	public void setPaymentType(String paymentType) {
		_paymentType = paymentType;
	}

	public Date getPaymentDate() {
		return _paymentDate;
	}

	public void setPaymentDate(Date paymentDate) {
		_paymentDate = paymentDate;
	}

	public String getReceiptNo() {
		return _receiptNo;
	}

	public void setReceiptNo(String receiptNo) {
		_receiptNo = receiptNo;
	}

	public String getInvoiceNo() {
		return _invoiceNo;
	}

	public void setInvoiceNo(String invoiceNo) {
		_invoiceNo = invoiceNo;
	}

	public String getApplicationType() {
		return _applicationType;
	}

	public void setApplicationType(String applicationType) {
		_applicationType = applicationType;
	}

	public String getBankCode() {
		return _bankCode;
	}

	public void setBankCode(String bankCode) {
		_bankCode = bankCode;
	}

	public String getBankName() {
		return _bankName;
	}

	public void setBankName(String bankName) {
		_bankName = bankName;
	}

	public String getBankReference() {
		return _bankReference;
	}

	public void setBankReference(String bankReference) {
		_bankReference = bankReference;
	}

	public String getAccountNo() {
		return _accountNo;
	}

	public void setAccountNo(String accountNo) {
		_accountNo = accountNo;
	}

	public Double getAmount() {
		return _amount;
	}

	public void setAmount(Double amount) {
		_amount = amount;
	}

	public Double getApprovedAmount() {
		return _approvedAmount;
	}

	public void setApprovedAmount(Double approvedAmount) {
		_approvedAmount = approvedAmount;
	}

	public Double getTransactionFee() {
		return _transactionFee;
	}

	public void setTransactionFee(Double transactionFee) {
		_transactionFee = transactionFee;
	}

	public String getBatchId() {
		return _batchId;
	}

	public void setBatchId(String batchId) {
		_batchId = batchId;
	}

	public String getStatus() {
		return _status;
	}

	public void setStatus(String status) {
		_status = status;
	}

	public String getResponseCode() {
		return _responseCode;
	}

	public void setResponseCode(String responseCode) {
		_responseCode = responseCode;
	}

	public String getResponseDescription() {
		return _responseDescription;
	}

	public void setResponseDescription(String responseDescription) {
		_responseDescription = responseDescription;
	}

	public String getPayRef() {
		return _payRef;
	}

	public void setPayRef(String payRef) {
		_payRef = payRef;
	}

	public String getRetRef() {
		return _retRef;
	}

	public void setRetRef(String retRef) {
		_retRef = retRef;
	}

	public String getCardNum() {
		return _cardNum;
	}

	public void setCardNum(String cardNum) {
		_cardNum = cardNum;
	}

	public Transactions toEscapedModel() {
		if (isEscapedModel()) {
			return this;
		}
		else {
			return (Transactions)Proxy.newProxyInstance(Transactions.class.getClassLoader(),
				new Class[] { Transactions.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		TransactionsClp clone = new TransactionsClp();

		clone.setTransactionNo(getTransactionNo());
		clone.setUserId(getUserId());
		clone.setTransactionRef(getTransactionRef());
		clone.setItemId(getItemId());
		clone.setItemDescription(getItemDescription());
		clone.setPaymentType(getPaymentType());
		clone.setPaymentDate(getPaymentDate());
		clone.setReceiptNo(getReceiptNo());
		clone.setInvoiceNo(getInvoiceNo());
		clone.setApplicationType(getApplicationType());
		clone.setBankCode(getBankCode());
		clone.setBankName(getBankName());
		clone.setBankReference(getBankReference());
		clone.setAccountNo(getAccountNo());
		clone.setAmount(getAmount());
		clone.setApprovedAmount(getApprovedAmount());
		clone.setTransactionFee(getTransactionFee());
		clone.setBatchId(getBatchId());
		clone.setStatus(getStatus());
		clone.setResponseCode(getResponseCode());
		clone.setResponseDescription(getResponseDescription());
		clone.setPayRef(getPayRef());
		clone.setRetRef(getRetRef());
		clone.setCardNum(getCardNum());

		return clone;
	}

	public int compareTo(Transactions transactions) {
		int value = 0;

		value = getTransactionNo().compareTo(transactions.getTransactionNo());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		TransactionsClp transactions = null;

		try {
			transactions = (TransactionsClp)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		String pk = transactions.getPrimaryKey();

		if (getPrimaryKey().equals(pk)) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return getPrimaryKey().hashCode();
	}

	public String toString() {
		StringBundler sb = new StringBundler(49);

		sb.append("{transactionNo=");
		sb.append(getTransactionNo());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", transactionRef=");
		sb.append(getTransactionRef());
		sb.append(", itemId=");
		sb.append(getItemId());
		sb.append(", itemDescription=");
		sb.append(getItemDescription());
		sb.append(", paymentType=");
		sb.append(getPaymentType());
		sb.append(", paymentDate=");
		sb.append(getPaymentDate());
		sb.append(", receiptNo=");
		sb.append(getReceiptNo());
		sb.append(", invoiceNo=");
		sb.append(getInvoiceNo());
		sb.append(", applicationType=");
		sb.append(getApplicationType());
		sb.append(", bankCode=");
		sb.append(getBankCode());
		sb.append(", bankName=");
		sb.append(getBankName());
		sb.append(", bankReference=");
		sb.append(getBankReference());
		sb.append(", accountNo=");
		sb.append(getAccountNo());
		sb.append(", amount=");
		sb.append(getAmount());
		sb.append(", approvedAmount=");
		sb.append(getApprovedAmount());
		sb.append(", transactionFee=");
		sb.append(getTransactionFee());
		sb.append(", batchId=");
		sb.append(getBatchId());
		sb.append(", status=");
		sb.append(getStatus());
		sb.append(", responseCode=");
		sb.append(getResponseCode());
		sb.append(", responseDescription=");
		sb.append(getResponseDescription());
		sb.append(", payRef=");
		sb.append(getPayRef());
		sb.append(", retRef=");
		sb.append(getRetRef());
		sb.append(", cardNum=");
		sb.append(getCardNum());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(76);

		sb.append("<model><model-name>");
		sb.append("com.crossriver.crgis.database.model.Transactions");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>transactionNo</column-name><column-value><![CDATA[");
		sb.append(getTransactionNo());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>transactionRef</column-name><column-value><![CDATA[");
		sb.append(getTransactionRef());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>itemId</column-name><column-value><![CDATA[");
		sb.append(getItemId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>itemDescription</column-name><column-value><![CDATA[");
		sb.append(getItemDescription());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>paymentType</column-name><column-value><![CDATA[");
		sb.append(getPaymentType());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>paymentDate</column-name><column-value><![CDATA[");
		sb.append(getPaymentDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>receiptNo</column-name><column-value><![CDATA[");
		sb.append(getReceiptNo());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>invoiceNo</column-name><column-value><![CDATA[");
		sb.append(getInvoiceNo());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>applicationType</column-name><column-value><![CDATA[");
		sb.append(getApplicationType());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>bankCode</column-name><column-value><![CDATA[");
		sb.append(getBankCode());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>bankName</column-name><column-value><![CDATA[");
		sb.append(getBankName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>bankReference</column-name><column-value><![CDATA[");
		sb.append(getBankReference());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>accountNo</column-name><column-value><![CDATA[");
		sb.append(getAccountNo());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>amount</column-name><column-value><![CDATA[");
		sb.append(getAmount());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>approvedAmount</column-name><column-value><![CDATA[");
		sb.append(getApprovedAmount());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>transactionFee</column-name><column-value><![CDATA[");
		sb.append(getTransactionFee());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>batchId</column-name><column-value><![CDATA[");
		sb.append(getBatchId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>status</column-name><column-value><![CDATA[");
		sb.append(getStatus());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>responseCode</column-name><column-value><![CDATA[");
		sb.append(getResponseCode());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>responseDescription</column-name><column-value><![CDATA[");
		sb.append(getResponseDescription());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>payRef</column-name><column-value><![CDATA[");
		sb.append(getPayRef());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>retRef</column-name><column-value><![CDATA[");
		sb.append(getRetRef());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>cardNum</column-name><column-value><![CDATA[");
		sb.append(getCardNum());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private String _transactionNo;
	private String _userId;
	private String _transactionRef;
	private String _itemId;
	private String _itemDescription;
	private String _paymentType;
	private Date _paymentDate;
	private String _receiptNo;
	private String _invoiceNo;
	private String _applicationType;
	private String _bankCode;
	private String _bankName;
	private String _bankReference;
	private String _accountNo;
	private Double _amount;
	private Double _approvedAmount;
	private Double _transactionFee;
	private String _batchId;
	private String _status;
	private String _responseCode;
	private String _responseDescription;
	private String _payRef;
	private String _retRef;
	private String _cardNum;
}